﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;

namespace BPM.Entity
{
	/// <summary>
	/// 物料定义所属的类别
	/// </summary>
	public class MaterialDefinitionCategory : BaseEntity
	{
		/// <summary>
		/// 类别名称
		/// </summary>
		public string Name { get; set; }

		private ILazyEntityRef<MaterialDefinitionCategory> _ParentCaregory;
		/// <summary>
		/// 父类别
		/// </summary>
		public MaterialDefinitionCategory ParentCategory
		{
			get
			{
				return this._ParentCaregory.Entity;
			}
			set
			{
				this._ParentCaregory.Entity = value;
			}
		}
		/// <summary>
		/// 父类别Id
		/// </summary>
		public int? ParentCategoryId
		{
			get
			{
				return this._ParentCaregory.NullableId;
			}
			set
			{
				this._ParentCaregory.NullableId = value;
			}
		}

		public DateTime CreateTime { get; set; }

		/// <summary>
		/// 子类别
		/// </summary>
		public IList<MaterialDefinitionCategory> SubCategoryList { get; set; }

		public MaterialDefinitionCategory()
		{
			this._ParentCaregory = this.CreateReference<MaterialDefinitionCategory>();
			this.CreateTime = DateTime.Now;
		}
	}
}
